package com.ipc.app.util.converter;

import com.ipc.app.dal.doObject.UserDO;
import com.ipc.app.model.User;

/**
 * @author 雪
 * 
 */
public class UserConverter {

	public static final User userDalToModel(UserDO userDO) {
		if (null == userDO) {
			return null;
		}
		User user = new User();
		user.setCreateTime(userDO.getCreateTime());
		user.setLastLoginTime(userDO.getLastLoginTime());
		user.setLoginChannel(userDO.getLoginChannel());
		user.setLoginId(userDO.getLoginId());
		user.setMobile(userDO.getMobile());
		user.setModifyTime(userDO.getModifyTime());
		user.setUserId(userDO.getUserId());
		user.setUserName(userDO.getUserName());
		user.setUserName(userDO.getUserType());
		return user;
	}

	public static final UserDO userModelToUserDal(User user) {
		UserDO userDO = new UserDO();
		userDO.setLastLoginTime(user.getLastLoginTime());
		userDO.setLoginChannel(user.getLoginChannel());
		userDO.setLoginId(user.getLoginId());
		userDO.setMobile(user.getMobile());
		userDO.setUserId(user.getUserId());
		userDO.setUserName(user.getUserName());
		userDO.setPassword(user.getPassword());
		userDO.setUserType(user.getUserType());
		return userDO;
	}
}
